package com.luotf.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.luotf.mapper.MenuMapper;
import com.luotf.model.Bloger;
import com.luotf.model.Menu;
import com.luotf.service.menuService;
import com.luotf.util.menuUtil;

@Service
public class menuServiceimpl implements menuService {

	@Autowired
	private MenuMapper menumapper;

	public List<Menu> queryByrole(Bloger bloger) {
		// 未经组装的菜单
		List<Menu> menus = menumapper.queryByrole(bloger);
		// 组装完成
		menus = menuUtil.AssemblyMenu(menus);

		return menus;
	}

	@Override
	public List<Menu> queryAll() {
		// 未经组装的菜单
		List<Menu> menus = menumapper.queryAll();
		// 组装完成
		menus = menuUtil.AssemblyMenu(menus);

		return menus;
	}

}
